-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix regex for apple-touch-icon #25025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
WDYT about adding a handful of test cases for this? |
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 29973 | |
| Version | PR #25025 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 396258a | |
| Installation URL | 4do3uvu533m8o |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 29973 | |
| Version | PR #25025 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 396258a | |
| Installation URL | 05r6qbt5f4ql8 |
Good idea. I generated a unit test suite for it. |
|
| let range = NSRange(location: 0, length: html.utf16.count) | ||
| if let match = regex?.firstMatch(in: html, options: [], range: range), | ||
| let matchRange = Range(match.range(at: 1), in: html), | ||
| let faviconURL = URL(string: String(html[matchRange]), relativeTo: siteURL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't spot any real issue here, but I think the casting between Range and NSRange, String and NSString, and potentially unsafe subscript, could be avoided by using Swift.Regex.
* Fix regex for apple-touch-icon (#25025) * Merge release_notes/26.5 into release/26.5 (#25036) * Update Jetpack release notes * Update metadata strings --------- Co-authored-by: Tony Li <[email protected]> * Update app translations – `Localizable.strings` * Update Jetpack metadata translations * Bump version number --------- Co-authored-by: Alex Grebenyuk <[email protected]> Co-authored-by: Tony Li <[email protected]>





Fixes regression introduced in #25023. I should not have trusted AI to write regex.
Notes:
Before:
After (making the group actually optional):